include "./conex/conex.php";
include "./lib/u_globales.php";
$num_eventos=5;
if ($tipo=='e'){
$tipo='id_tipo=2';
}
if ($tipo=='t'){
$tipo='id_tipo=3';
}
$q_paginar="select * from datos_elementos where $tipo order by fecha desc";
$q_paginar=mysql_query($q_paginar);
$cuantos=mysql_num_rows($q_paginar);
$paginas=$cuantos / $num_eventos;
$resto=$cuantos % $num_eventos;
$sacamos=0;
if (!isset($pagina_act)){
$pagina_act=1;
}else{
$sacamos=($pagina_act-1)*$num_eventos;
}
if($resto>0){$paginas=$paginas+1;}
$q_lista_elementos="select * from datos_elementos where $tipo order by fecha desc limit $sacamos,$num_eventos";
$q_lista_elementos=mysql_query($q_lista_elementos);
if(!isset($id_elemento)){
$r_lista_elementos=mysql_fetch_array($q_lista_elementos);
$id_elemento=$r_lista_elementos['id_elemento'];
}
$q_eventos="select * from datos_elementos where id_elemento=$id_elemento";
$q_eventos=mysql_query($q_eventos);
$r_evento=mysql_fetch_array($q_eventos);
$q_evento_foto="SELECT id_foto,id_elemento FROM torneo_img WHERE id_elemento=$id_elemento";
$q_evento_foto=mysql_query($q_evento_foto);
$r_evento_n_foto=mysql_num_rows($q_evento_foto);
function LocalizaFoto($id_elemento,$n)
{
$q_evento_foto="SELECT id_foto,id_elemento,orden FROM torneo_img WHERE id_elemento=$id_elemento";
$q_evento_foto=mysql_query($q_evento_foto);
$r_evento_n_foto=mysql_num_rows($q_evento_foto);
if ($r_evento_n_foto > $n-1) {
mysql_data_seek ($q_evento_foto, $n-1);
$r_evento_foto=mysql_fetch_array($q_evento_foto);
PintarImagen($r_evento_foto['id_foto'],$r_evento_foto['id_elemento'],$r_evento_foto['orden']);
} else {
echo "";
}
}
function PintarImagen($id_foto,$id_elemento,$orden)
{
echo "
";
}
?>
Golf Extremadura - Organizalia.com eventos de golf, el enlace entre el ocio y el negocio
if ($r_evento['id_tipo']==3){include "cont_torneos.php";}
if ($r_evento['id_tipo']==2){ include "cont_eventos.php";}
?>
if ($r_evento['id_tipo']==3){ ?> Torneos } ?>
if ($r_evento['id_tipo']==2){ ?> Eventos } ?>
if ($paginas>=2){
echo('<');
for ($i==0;$i<=$paginas;$i++){
if ($i==$pagina_act){
echo(''.$i.' ');
}else{
echo(''.$i.' ');
}
}
echo('>');
}
?>
if (mysql_num_rows($q_lista_elementos)>=1){
mysql_data_seek($q_lista_elementos,0);
}
while ($r_lista_elementos=mysql_fetch_array($q_lista_elementos)){
?>